package com.ruoyi.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.OrderRegisterBankRecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;

/**
 * 银行对账
 */
@RestController
@RequestMapping("/hotel/order/registerBankRec")
public class OrderRegisterBankRecController extends BaseController {

    @Autowired
    OrderRegisterBankRecService orderRegisterBankRecService;

    /**
     * 查询银行卡对账数据
     * @param map
     * @return
     */
    @GetMapping("/getBankRecList")
    public AjaxResult getBankRecList(@RequestParam Map map) {
        return AjaxResult.success(orderRegisterBankRecService.getBankRecList(map));
    }

    /**
     * 根据id查询银行对账数据
     * @param id
     * @return
     */
    @GetMapping("/getBankRecById")
    public AjaxResult getBankRecById(@RequestParam String id) {
        return success(orderRegisterBankRecService.getBankRecById(id));
    }

    /**
     * 编辑银行卡对账数据
     * @param map
     * @return
     */
    @PostMapping("/postEditBankRec")
    public AjaxResult postEditBankRec(@RequestBody Map map) {
        return orderRegisterBankRecService.postEditBankRec(map);
    }

    /**
     * 新增银行卡对账数据
     * @param map
     * @return
     */
    @PostMapping("/postAddBankRec")
    public AjaxResult postAddBankRec(@RequestBody Map map) {
        return toAjax(orderRegisterBankRecService.postAddBankRec(map));
    }

    /**
     * 取消确认对账
     * @param map
     * @return
     */
    @PostMapping("/postCancelSeal")
    public AjaxResult postCancelSeal(@RequestBody Map map){
        return orderRegisterBankRecService.postCancelSeal(map);
    }

    /**
     * 确认对账
     * @param map
     * @return
     */
    @PostMapping("/postConfirmSeal")
    public AjaxResult postConfirmSeal(@RequestBody Map map){
        return orderRegisterBankRecService.postConfirmSeal(map);
    }
}
